require(['jquery', 'cookie', 'app', "lay"], function ($) {
    require(['vue'], function (Vue) {
        var dic = new Vue({
            el: ".vue-box"
            , data: {
                where: {},
                userInfo: {},
                money: "",
                thatUser: "",
            }
            , created: function () {
                this.userInfo = JSON.parse(localStorage.getItem("userInfo"));
                this.loadPage();
            }
            , methods: {
                loadPage: function () {
                    load();
                    var toolbar = [];
                    var tool = [];
                    bspVIEW($("#authoritiesTable"), "/v1/api/shopOrder/spack/all", [
                        {type: 'radio',width: 150},
                        {type: 'numbers'},
                        {
                            templet: function (d) {
                                return d.shopOrder.id;
                            },
                            align: 'center',
                            width: 120,
                            title: '订单Id'
                            , minWidth: 120
                        },
                        {
                            templet: function (d) {
                                return d.users.name;
                            },
                            align: 'center',
                            width: 120,
                            title: '用户名称'
                            , minWidth: 120
                        },
                        {
                            templet: function (d) {
                                return d.shopOrder.count;
                            },
                            align: 'center',
                            width: 120,
                            title: '商品数量'
                            , minWidth: 120
                        },
                        {
                            templet: function (d) {
                                return d.shopOrder.incomeMoney;
                            },
                            align: 'center',
                            width: 120,
                            title: '应收金额'
                            , minWidth: 120
                        },
                        {
                            templet: function (d) {
                                return d.shopOrder.money;
                            },
                            align: 'center',
                            width: 120,
                            title: '实收金额'
                            , minWidth: 120
                        },
                        {
                            templet: function (d) {
                                return d.shopOrder.annul;
                            },
                            align: 'center',
                            width: 120,
                            title: '抵扣金额'
                            , minWidth: 120
                        },
                        {
                            templet: function (d) {
                                if (d.status) {
                                    return "<p style='background-color: yellow;color: black'>已处理</p>";
                                } else {
                                    return "<p style='background-color:green;color: white'>未处理</p>";
                                }
                            },
                            align: 'center',
                            width: 120,
                            title: '处理状态'
                            , minWidth: 120
                        }
                    ], {common: this.where}, toolbar, tool, function (res, curr, count) {

                    });
                },
                seachs: function () {
                    this.where = fromName($(".el-form"));
                    this.loadPage();
                },
                refer: function () {

                }
            }
        });
    })
});